package com.lb.activity.mapper;

import com.lb.activity.po.RolePermission;
import org.apache.ibatis.annotations.Insert;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author liubin
 */
public interface RolePermissionMapper extends Mapper<RolePermission> {


    @Insert({"<script> INSERT INTO role_permission (ID,ROLEID, PERMISSIONID) " +
            "values " +
            "<foreach collection=\"list\" item=\"item\" index=\"index\"  separator=\",\"> "+
            "      (#{item.id,jdbcType=BIGINT},#{item.roleid,jdbcType=BIGINT},#{item.permissionid,jdbcType=BIGINT})\n" +
            "</foreach> </script>"})
    void batchSave(List<RolePermission> storeRolePermissions);
}
